<!DOCTYPE html>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>highlight.pl</title>
<meta name="generator" content="KF5::SyntaxHighlighting (Perl)"/>
</head><body style="color:#1f1c1b"><pre>
<span style="font-weight:bold;">#!/usr/bin/perl -w</span>
<span style="color:#898887;"># This is a pseudo Perl file to test Kate's Perl syntax highlighting.</span>
<span style="color:#898887;"># </span><span style="color:#ca9219;background-color:#451e1a;font-weight:bold;">TODO</span><span style="color:#898887;">: this is incomplete, add more syntax examples!</span>

<span style="font-weight:bold;">sub </span><span style="color:#644a9b;">prg</span>(<span style="color:#0057ae;">$</span>)
{
	<span style="font-weight:bold;">my</span> <span style="color:#0057ae;">$var</span> = <span style="color:#644a9b;">shift</span>;

	<span style="color:#0057ae;">$var</span> =~ <span style="color:#008000;font-weight:bold;">s/</span><span style="color:#006e28;">bla</span><span style="color:#008000;font-weight:bold;">/</span><span style="color:#bf0303;">foo</span><span style="color:#008000;font-weight:bold;">/igs</span>;
	<span style="color:#0057ae;">$var</span> =~ <span style="color:#008000;font-weight:bold;">s!</span><span style="color:#006e28;">bla</span><span style="color:#008000;font-weight:bold;">!</span><span style="color:#bf0303;">foo</span><span style="color:#008000;font-weight:bold;">!igs</span>;
	<span style="color:#0057ae;">$var</span> =~ <span style="color:#008000;font-weight:bold;">s#</span><span style="color:#006e28;">bla</span><span style="color:#008000;font-weight:bold;">#</span><span style="color:#bf0303;">foo</span><span style="color:#008000;font-weight:bold;">#igs</span>;
	<span style="color:#0057ae;">$var</span> =~ <span style="color:#008000;font-weight:bold;">tr</span><span style="color:#006e28;">/a-z/A-Z/</span>;
	(<span style="color:#0057ae;">$match</span>) = (<span style="color:#0057ae;">$var</span> =~ <span style="color:#008000;font-weight:bold;">m/</span><span style="color:#924c9d;">(</span><span style="color:#006e28;">.</span><span style="color:#924c9d;">*?)</span><span style="color:#008000;font-weight:bold;">/igs</span>);

	<span style="color:#0057ae;">$test</span> = <span style="color:#b08000;">2</span>/<span style="color:#b08000;">453453.21</span>;
	<span style="color:#0057ae;">$test</span> /= <span style="color:#b08000;">2</span>;

	<span style="color:#644a9b;">print</span> <span style="color:#008000;font-weight:bold;">qq~</span><span style="color:#bf0303;">d fsd fsdf sdfl sd</span><span style="color:#008000;font-weight:bold;">~</span>
	
	<span style="color:#c00000;">$&quot;</span> = <span style="color:#008000;font-weight:bold;">'</span><span style="color:#ff6c6c;">/</span><span style="color:#008000;font-weight:bold;">'</span>;
	
	<span style="color:#0057ae;">$foo</span> = <span style="color:#008000;font-weight:bold;">&lt;&lt;</span><span style="font-weight:bold;">__EOF;</span>
<span style="color:#bf0303;">d ahfdklf klsdfl sdf sd</span>
<span style="color:#bf0303;">fsd sdf sdfsdlkf sd</span>
<span style="font-weight:bold;">__EOF</span>

	<span style="color:#0057ae;">$x</span> = <span style="color:#008000;font-weight:bold;">&quot;</span><span style="color:#bf0303;">dasds</span><span style="color:#008000;font-weight:bold;">&quot;</span>;

	<span style="font-weight:bold;">next</span> <span style="font-weight:bold;">if</span>( <span style="color:#0057ae;">$match</span> <span style="color:#008000;font-weight:bold;">eq</span> <span style="color:#008000;font-weight:bold;">&quot;</span><span style="color:#bf0303;">two</span><span style="color:#008000;font-weight:bold;">&quot;</span> );
	<span style="font-weight:bold;">next</span> <span style="font-weight:bold;">if</span>( <span style="color:#0057ae;">$match</span> =~ <span style="color:#008000;font-weight:bold;">/</span><span style="color:#006e28;">go</span><span style="color:#008000;font-weight:bold;">/i</span> );

	<span style="color:#0057ae;">@array</span> = (<span style="color:#b08000;">1</span>,<span style="color:#b08000;">2</span>,<span style="color:#b08000;">3</span>);		<span style="color:#898887;"># a comment</span>
	<span style="color:#0057ae;">@array</span> = <span style="color:#008000;font-weight:bold;">qw(</span>apple foo bar<span style="color:#008000;font-weight:bold;">)</span>;
	<span style="color:#644a9b;">push</span>(<span style="color:#0057ae;">@array</span>, <span style="color:#b08000;">4</span>);
	<span style="color:#0057ae;">%hash</span> = (red =&gt; <span style="color:#008000;font-weight:bold;">'</span><span style="color:#ff6c6c;">rot</span><span style="color:#008000;font-weight:bold;">'</span>,
		blue =&gt; <span style="color:#008000;font-weight:bold;">'</span><span style="color:#ff6c6c;">blau</span><span style="color:#008000;font-weight:bold;">'</span>);
	<span style="color:#644a9b;">print</span> <span style="color:#644a9b;">keys</span>(<span style="color:#0057ae;">%hash</span>);
}

<span style="font-weight:bold;">sub </span><span style="color:#644a9b;">blah</span> {
    <span style="font-weight:bold;">my</span> <span style="color:#0057ae;">$str</span> = <span style="color:#008000;font-weight:bold;">&lt;&lt;</span><span style="font-weight:bold;"> '    EOS';</span>
        this is my string
        and it's continuation
<span style="font-weight:bold;">    EOS</span>

    <span style="color:#0057ae;">$str</span> = <span style="color:#008000;font-weight:bold;">&quot;</span><span style="color:#bf0303;">hello world</span><span style="color:#008000;font-weight:bold;">&quot;</span>;

    <span style="color:#0057ae;">$str</span> = <span style="color:#008000;font-weight:bold;">&lt;&lt;</span><span style="font-weight:bold;"> &quot;    EOS&quot;;</span>
<span style="color:#bf0303;">        this is my string</span>
<span style="color:#bf0303;">        and it's continuation</span>
<span style="font-weight:bold;">    EOS</span>
}

&amp;blah;
prg(<span style="color:#008000;font-weight:bold;">&quot;</span><span style="color:#bf0303;">test</span><span style="color:#008000;font-weight:bold;">&quot;</span>);

<span style="color:#898887;"># Bracket closures in RegExp patterns (bug #364866)</span>
<span style="color:#008000;font-weight:bold;">qr{</span><span style="color:#006e28;"> </span><span style="color:#924c9d;">$</span><span style="color:#006e28;">{var} aa{aa{a}a} aa</span><span style="color:#924c9d;">*</span><span style="color:#006e28;">b</span><span style="color:#924c9d;">?</span><span style="color:#008000;font-weight:bold;">}</span>;
<span style="color:#008000;font-weight:bold;">qr(</span><span style="color:#006e28;">aa</span><span style="color:#924c9d;">(</span><span style="color:#006e28;">a</span><span style="color:#924c9d;">(</span><span style="color:#006e28;">a</span><span style="color:#924c9d;">(</span><span style="color:#006e28;">a</span><span style="color:#924c9d;">(</span><span style="color:#006e28;">b</span><span style="color:#924c9d;">|</span><span style="color:#006e28;">c</span><span style="color:#924c9d;">)</span><span style="color:#006e28;">a</span><span style="color:#924c9d;">)</span><span style="color:#006e28;">a</span><span style="color:#924c9d;">)</span><span style="color:#006e28;">a</span><span style="color:#924c9d;">)</span><span style="color:#006e28;">aa</span><span style="color:#924c9d;">*</span><span style="color:#006e28;">b</span><span style="color:#924c9d;">?</span><span style="color:#008000;font-weight:bold;">)</span>;
<span style="color:#008000;font-weight:bold;">s{</span><span style="color:#006e28;">aaa {aaa} a </span><span style="color:#c00000;">\x{A2}</span><span style="color:#006e28;"> </span><span style="color:#924c9d;">*</span><span style="color:#006e28;">b</span><span style="color:#924c9d;">?</span><span style="color:#008000;font-weight:bold;">}{</span><span style="color:#bf0303;">aa</span><span style="color:#008000;font-weight:bold;">}</span>;
<span style="color:#008000;font-weight:bold;">s(</span><span style="color:#006e28;">aa</span><span style="color:#924c9d;">(</span><span style="color:#006e28;">a</span><span style="color:#924c9d;">(</span><span style="color:#006e28;">a</span><span style="color:#924c9d;">(</span><span style="color:#006e28;">a</span><span style="color:#924c9d;">(</span><span style="color:#006e28;">b</span><span style="color:#924c9d;">|</span><span style="color:#006e28;">c</span><span style="color:#924c9d;">)</span><span style="color:#006e28;">a</span><span style="color:#924c9d;">)</span><span style="color:#006e28;">a</span><span style="color:#924c9d;">)</span><span style="color:#006e28;">a</span><span style="color:#924c9d;">)</span><span style="color:#006e28;">aa</span><span style="color:#008000;font-weight:bold;">)(</span><span style="color:#bf0303;">aa</span><span style="color:#008000;font-weight:bold;">)</span>;

<span style="color:#898887;"># Strings as scalar references (bug #348765)</span>
<span style="color:#0057ae;">$x</span> = \<span style="color:#008000;font-weight:bold;">'</span><span style="color:#ff6c6c;">Reference of a String</span><span style="color:#008000;font-weight:bold;">'</span>;
<span style="color:#0057ae;">$y</span> = \<span style="color:#008000;font-weight:bold;">&quot;</span><span style="color:#bf0303;">Reference of a String</span><span style="color:#008000;font-weight:bold;">&quot;</span>;

<span style="color:#898887;"># Variables that start with underscore (bug #355300)</span>
<span style="color:#0057ae;">$_variable</span>
<span style="color:#c00000;">$_</span> <span style="color:#898887;"># Reserved var.</span>

<span style="font-weight:bold;">for</span> <span style="font-weight:bold;">my</span> <span style="color:#0057ae;">$x</span> (<span style="color:#0057ae;">$hash</span>-&gt;{arr}-&gt;<span style="color:#0057ae;">@</span><span style="color:#008000;font-weight:bold;">*</span>) {
    <span style="font-weight:bold;">for</span> <span style="font-weight:bold;">my</span> <span style="color:#0057ae;">$k</span> (<span style="color:#644a9b;">keys</span> <span style="color:#0057ae;">$k</span>-&gt;%<span style="color:#008000;font-weight:bold;">*</span>) {
        ...
    }
}

<span style="color:#898887;"># Highlight correctly operator // (bug #407327)</span>
<span style="color:#0057ae;">$x</span> = ns // <span style="color:#008000;font-weight:bold;">&quot;&quot;</span>;
<span style="color:#644a9b;">print</span> <span style="color:#0057ae;">$x</span>;
</pre></body></html>
